using System;
using UnityEngine;

namespace IQIGame.Onigao.Game.Editors
{
    public enum ActionParamType
    {
        None = 0,
        Animation = 1
    }
    public class CfgFSMStateParam
    {
        public ActionParamType actionParamType;
        public Type paramType;
        public object paramValue;

        public CfgFSMStateParam(string content)
        {
            string[] texts = content.Split(':');
            if (texts.Length < 2)
            {
                Debug.LogError("Action参数格式错误。");
                return;
            }
            if (Enum.TryParse(texts[0], out ActionParamType type))
            {
                actionParamType = type;
            }
            else
            {
                Debug.LogError("不支持的Action参数类型：" + texts[0]);
                return;
            }
            EdtCfgFSMUtil.ParseParamValue(texts[1], out paramType, out paramValue);
        }
    }
}